Skip to content

audit_configs.R: trustworthy pre-trifecta gate (rollup + honest findings)#214

Merged
NewGraphEnvironment merged 3 commits into
mainfrom
audit-configs-honesty
May 29, 2026
Merged

audit_configs.R: trustworthy pre-trifecta gate (rollup + honest findings)#214
NewGraphEnvironment merged 3 commits into
mainfrom
audit-configs-honesty

Conversation

@NewGraphEnvironment

Copy link
Copy Markdown
Owner

Summary

Makes data-raw/audit_configs.R a trustworthy pre-trifecta gate. Three commits:

  • §3b column-drift check (f24f301) — compares fresh's canonical parameters_fresh.csv column set against each link bundle's copy. Flags engine params fresh added that link is missing; treats observation_* as expected link-only extensions. Closes the parameters_fresh half of the fresh↔link config-drift gap (rules.yaml half tracked in Auto-sync parameters_habitat_rules.yaml from link to fresh on rules-build #129).
  • Rollup + non-zero exit (106dffe) — routes every !!-level finding through a flag() accumulator, prints a single end-of-run rollup, and quit(status=1) when any fired (guarded by !interactive()). Previously findings scrolled past inline with no summary and the script always exited 0, so the trifecta could not gate on a clean audit.
  • Eliminate 30 false positives (04f6494) — all 30 findings the audit emitted were audit-side defects, not config drift (lnk_config_verify reports 0 byte/shape drift in both bundles):
    • §1 now calls the canonical lnk_config_verify() instead of a divergent homegrown checksum recipe (was a 24/24 spurious shape-drift wall)
    • §2 regenerates rules.yaml with edge_types="explicit" to match how the committed copy is built
    • §3 splits species-axis mismatches into flagged defects vs informational expected asymmetries
    • §4 resolves declared paths against bundle_dir and compares full relative paths (basename-matching mis-flagged root-level parameters_fresh.csv)

Audit now reports "No findings — config layers aligned." and exits 0.

Related Issues

Test plan

  • Rscript data-raw/audit_configs.R → "No findings — config layers aligned.", exit 0
  • /code-check clean (fresh-eyes subagent ran the script end-to-end)

🤖 Generated with Claude Code

NewGraphEnvironment and others added 3 commits May 28, 2026 22:03
Add section 3b comparing fresh's canonical parameters_fresh.csv column
set against each link bundle's copy. Flags columns fresh added that link
is missing (link's copy may no longer load through frs_habitat); treats
observation_* as expected link-only extensions. Report-only, values
ignored. Closes the parameters_fresh half of the fresh/link config
drift gap (rules.yaml half tracked in #129).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
… exit

Route every `!!`-level finding (sections 1-5) through a flag() accumulator,
then print a single rollup at the end and quit(status=1) when any fired
(guarded by !interactive()). Previously findings printed inline across six
sections with no summary and the script always exited 0, so any flag could
scroll past unnoticed and the trifecta could not gate on a clean audit.
Uniform across all checks — no single check is special-cased louder.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
All 30 findings the audit emitted were audit-side defects, not config
drift (lnk_config_verify reports 0 byte/shape drift in both bundles).
Four fixes:

- §1: drop the homegrown shape/byte checksum reimplementation and call
  the canonical lnk_config_verify() instead. The local recipe diverged
  from .lnk_shape_fingerprint (list(cols,nrow,types) serialize=TRUE vs
  header-row hash serialize=FALSE), producing a 24/24 spurious
  shape-drift wall.
- §2: regenerate rules.yaml with edge_types="explicit" to match how the
  committed copy is actually built (build_rules.R + regen_provenance.R).
  "categories" produced an all-species phantom diff.
- §3: split species-axis mismatches into defects (dim∖pf, yaml∖dim —
  flagged) vs expected asymmetries (pf∖dim, pf∖wsg, dim∖yaml — printed
  only). The expected directions are by-design supersets, not drift.
- §4: resolve declared paths against bundle_dir and compare full
  bundle-relative paths instead of basenames. Basename-matching only the
  overrides/ dir mis-flagged root-level parameters_fresh.csv as missing.

Audit now reports "No findings — config layers aligned." and exits 0.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@NewGraphEnvironment NewGraphEnvironment merged commit 0e31c3d into main May 29, 2026
1 check passed
@NewGraphEnvironment NewGraphEnvironment deleted the audit-configs-honesty branch May 29, 2026 07:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant